package com.forum.user.controller;


import com.forum.common.utils.R;
import com.forum.user.entity.ForumUser;
//import com.forum.user.mapper.ForumUserFollowMapper;
import com.forum.user.service.ForumUserFollowService;
import com.forum.user.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bncgnc
 * @since 2022-01-04
 */
@Controller
@RequestMapping("/user/forumUserFollow")
public class ForumUserFollowController {
    @Autowired
    private ForumUserFollowService forumUserFollowService;


    /**
     * 添加关注用户
     * @param id 登录的用户id
     * @param forumUser 要关注的目标用户参数
     * @return
     */
    public R addUserFollow(Long id,ForumUser forumUser){
        return forumUserFollowService.addUserFollow(id,forumUser);
    }

    //删除关注用户

    /**
     * 删除关注用户
     * @param id 登录用户的id
     * @param forumUser 删除的目标用户的信息
     * @return
     */
    public R removeUserFollow(Long id,ForumUser forumUser){
        return forumUserFollowService.removeUserFollow(id,forumUser);

    }

    /**
     * 查找关注用户
     * @param id 登录用户的id
     * @param nickName 根据目标用户的昵称查询的目标用户
     * @return
     */
    public R findFollowUserByName(Long id, String nickName){
        return forumUserFollowService.findFollowUserByName(id,nickName);
    }

    //listAllFollowUser

    /**
     * 列出所有已经关注的用户
     * @param id
     * @return
     */
    public R listAllFollowUser(Long id){
        return forumUserFollowService.listAllFollowUser(id);
    }



}

